package day2.线程池.demo3;

import java.util.concurrent.ThreadFactory;
import java.util.concurrent.atomic.AtomicInteger;

public class Myfactory implements ThreadFactory {
    AtomicInteger num = new AtomicInteger(1);
    @Override
    public Thread newThread(Runnable r) {
        Thread t = new Thread(r,"线程--"+num.getAndIncrement());
        return t;
    }
}
